<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import ="service.*,java.util.*,bean.*" %>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    
  </head>
<body>

<div class="container theme-showcase" role="main">

<div class="jumbotron">
<h1>欢迎来到德莱联盟</h1>
<p>This is a bla bla bla bla bla bla bla bla bla.</p>
</div>
<div class="page-header">
<h1>用户信息</h1>
</div>
<%
AdminService as =new AdminService();
ArrayList<Admin> results =as.queryAll();
%>
<table class="table table-striped">
 <thead>
              <tr>
                <th>ID</th>
                <th>Username</th>
                <th>Password</th>
              </tr>
            </thead>
<%for(int i =0;i<results.size();i++) {
	Admin admin =results.get(i);
%>

<tbody>
<tr>
<td><%=admin.getId() %></td>
<td><%=admin.getUsername() %></td>
<td><%=admin.getPassword() %></td>
<td><a class="btn btn-warning" href="do_edit.jsp?id=<%=admin.getId()%>">编辑</a></td>
<td><a class="btn btn-danger" href="do_delete.jsp?id=<%=admin.getId()%>">删除</a></td>
</tr>
</tbody>
<%}
as.close();
%>
</table>
<a class="btn btn-primary" href="add_user.jsp">添加用户</a>
</div> 
</body>
</html>